import { Injectable } from '@angular/core';
import { Observable } from 'rxjs';

@Injectable({
  providedIn: 'root'
})
export class RequestService {

  constructor() { }

  getRxjsData() {
    let count: number = 0
    return new Observable(observer => {
      setInterval(() => {
        count++
        observer.next(count)
        // observer.error('失败的数据')
      }, 1000);
    })
  }
}
